package cn.xtuali.onlineide.dao.impl;



import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import cn.xtuali.onlineide.dao.UserDao;
import cn.xtuali.onlineide.entity.User;
@Repository
public class UserDaoImpl implements UserDao{
	@Autowired
	private SqlSessionTemplate sqlSessionTemplate;
	@Override
	public User getUserById(int userId) {
		User user = (User)sqlSessionTemplate.selectOne("user.getUserById", userId);
		return user;
	}
	@Override
	public User getUserByName(String userName) {
		User user = (User)sqlSessionTemplate.selectOne("user.getUserByName", userName);
		return user;
	}
	
	
}
